package com.bjwl.modules.common.pojo;

import java.util.Map;

/**
 * 作者 Administrator<br/>
 * 创建时间: 2021/11/28<br/>
 * 描述: controller调用分页
 */

public class MyPage {
    private long pageNo;
    private long pageSize;

    public long getPageNo() {
        return pageNo;
    }

    public long getPageSize() {
        return pageSize;
    }

    public MyPage(Map<String, Object> params){

        String pageIndex = null;
        String size = null;
        try {
            pageIndex = params.get("pageIndex").toString();
            size = params.get("pageSize").toString();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("当前页或页面记录数传入参数名错误！");
        }

        try {
            pageSize = Long.parseLong(size);
            pageNo = Long.parseLong(pageIndex);
        } catch (NumberFormatException e) {
            e.printStackTrace();
            System.out.println("当前页或页面记录数数据类型转换错误！");
        }
    }
}
